import Vue from 'vue';
//配置路由
import VueRouter from 'vue-router'
Vue.use(VueRouter);
//1.创建组件
import Index from '@/views/index'
import Home from '@/views/home'
import Login from '@/views/login'
import NotFound from '@/views/404'
import UpdatePassword from '@/views/update-password'
import register from '@/views/register'
import center from '@/views/center'
import pay from '@/views/pay'
import newsinfo from '@/views/modules/news/newsinfo'

import wodelingyang from '@/views/modules/gerenzhongxin/wodelingyang'
import wodetiezi from '@/views/modules/gerenzhongxin/wodetiezi'

// import xinxizixun from '@/views/modules/dongwujiuzhu/xinxizixun'
import baoguangtai from '@/views/modules/dongwujiuzhu/baoguangtai'
import liulangdongwujubao from '@/views/modules/dongwujiuzhu/liulangdongwujubao'

import lingyangzhongxin from '@/views/modules/dongwulingyang/lingyangzhongxin'
import lingyanghuifang from '@/views/modules/dongwulingyang/lingyanghuifang'

import luntanzixun from '@/views/modules/luntanzixun/luntanzixun'

import detileCommoity from '@/views/modules/aixinbankuai/detileCommoity'
import pingtaishangcheng from '@/views/modules/aixinbankuai/pingtaishangcheng'
import juanzhuwomen from '@/views/modules/aixinbankuai/juanzhuwomen'

import discusschongwulingyang from '@/views/modules/discusschongwulingyang/list'
import discusschongwuguashi from '@/views/modules/discusschongwuguashi/list'
import wodedingdan from '@/views/modules/gerenzhongxin/wodedingdan'


//2.配置路由   注意：名字
const routes = [{
  path: '/index',
  name: '首页',
  component: Index,
  children: [{
    // 这里不设置值，是把main作为默认页面
    path: '/',
    name: '首页',
    component: Home,
    meta: { icon: '', title: 'center' }
  },
  {
    path: '/updatePassword',
    name: '修改密码',
    component: UpdatePassword,
    meta: { icon: '', title: 'updatePassword' }
  },
  {
    path: '/pay',
    name: '支付',
    component: pay,
    meta: { icon: '', title: 'pay' }
  }, 
  {
    path: '/newsinfo',
    name: '资讯详情',
    component: newsinfo,
    meta: { icon: '', title: 'newsinfo' }
  }, 
  {
    path: '/wodedingdan',
    name: '我的订单',
    component: wodedingdan,
    meta: { icon: '', title: 'wodedingdan' }
  }, 
  {
    path: '/discusschongwulingyang',
    name: '宠物领养评论',
    component: discusschongwulingyang,
    meta: { icon: '', title: 'discusschongwulingyang' }
  },
  {
    path: '/discusschongwuguashi',
    name: '宠物评论',
    component: discusschongwuguashi,
    meta: { icon: '', title: 'discusschongwuguashi' }
  },
  {
    path: '/center',
    name: '个人信息',
    component: center,
    meta: { icon: '', title: 'center' }
  },
  {
    path: '/wodelingyang',
    name: '我的领养',
    component: wodelingyang
  },
  {
    path: '/wodetiezi',
    name: '我的帖子',
    component: wodetiezi
  },
  // {
  //   path: '/xinxizixun',
  //   name: '信息资讯',
  //   component: xinxizixun
  // },
  {
    path: '/baoguangtai',
    name: '曝光台',
    component: baoguangtai
  },
  {
    path: '/liulangdongwujubao',
    name: '流浪动物举报',
    component: liulangdongwujubao
  },

  {
    path: '/lingyangzhongxin',
    name: '领养中心',
    component: lingyangzhongxin
  },
  {
    path: '/lingyanghuifang',
    name: '领养回访',
    component: lingyanghuifang
  },
  {
    path: '/luntanzixun',
    name: '论坛资讯',
    component: luntanzixun
  },
  {
    path: '/detileCommoity',
    name: '商品细节',
    component: detileCommoity
  },
  {
    path: '/juanzhuwomen',
    name: '捐助我们',
    component: juanzhuwomen
  },
  {
    path: '/pingtaishangcheng',
    name: '平台商城',
    component: pingtaishangcheng
  }

  ]
},
{
  path: '/login',
  name: 'login',
  component: Login,
  meta: { icon: '', title: 'login' }
},
{
  path: '/register',
  name: 'register',
  component: register,
  meta: { icon: '', title: 'register' }
},
{
  path: '/',
  name: '首页',
  redirect: '/index'
}, /*默认跳转路由*/
{
  path: '*',
  component: NotFound
}
]
//3.实例化VueRouter  注意：名字
const router = new VueRouter({
  mode: 'hash',
  /*hash模式改为history*/
  routes // （缩写）相当于 routes: routes
})

export default router;
